﻿using System;
using Newtonsoft.Json;

namespace ChinaTax.LeQi
{
    public class BatchGetInvoiceCodeRequest : Request<BatchGetInvoiceCodeResponse>
    {
        public BatchGetInvoiceCodeRequest()
        {
            ServiceCode = "QDFPPLFM";

            //业务流水号，由“使用单位 id”+“直连单位 id”+“32 位随机生成码”组成
            No =  LeQiConfig.LeQiId + LeQiConfig.LeQiId + Guid.NewGuid().ToString("N");
        }

        [JsonProperty("nsrsbh")]
        public string TaxNo { get => LeQiConfig.TaxNo; }

        [JsonProperty("lysl")]
        public int Count { get => 5000; }

        [JsonProperty("ywlsh")]
        public string No { get; }
    }

    public class BatchGetInvoiceCodeResponse : Response
    {
        [JsonProperty("lysl")]
        public int Count { get; set; }

        [JsonProperty("fpqshm")]
        public string BeginNumber { get; set; }

        [JsonProperty("fpzzhm")]
        public string EndNumber { get; set; }
    }

}
